package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.UniversityScholarshipDto;
import xyz.zhouzhaodong.crm.service.IUniversityScholarshipService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 高校奖学金 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-22
 */
@RestController
@RequestMapping("/university-scholarship")
public class UniversityScholarshipController {

    @Resource
    IUniversityScholarshipService universityScholarshipService;

    /**
     * 新增高校奖学金
     * @param universityScholarshipDto
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addUniversityScholarship(UniversityScholarshipDto universityScholarshipDto){
        return universityScholarshipService.addUniversityScholarship(universityScholarshipDto);
    }

    /**
     * 删除高校奖学金
     * @param universityScholarshipDto
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteUniversityScholarship(UniversityScholarshipDto universityScholarshipDto){
        return universityScholarshipService.deleteUniversityScholarship(universityScholarshipDto);
    }

    /**
     * 修改高校奖学金
     * @param universityScholarshipDto
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateUniversityScholarship(UniversityScholarshipDto universityScholarshipDto){
        return universityScholarshipService.updateUniversityScholarship(universityScholarshipDto);
    }

    /**
     * 查询高校奖学金
     * @param universityScholarshipDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectUniversityScholarship(UniversityScholarshipDto universityScholarshipDto){
        return universityScholarshipService.selectUniversityScholarship(universityScholarshipDto);
    }

}
